﻿using Xejen.Communication.Soap.Extensions;
using Xejen.Hosting;
using Xejen.Logger;
using Xejen.Logger.NLog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Xejen.Communication.Wcf.Demos
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            ILoggerManager loggerManager = NLogManager.Instance();
            WinFormAppHost<MainForm> host = new WinFormAppHost<MainForm>(new HostConfiguration { }, loggerManager);

            #region 构建Wcf的Soap通讯
            host
                .UseSoapCommunication((builder) =>
                {
                    builder.ConfigureSoapConfiguration((config) => { }).AddCommunicator();
                })
                .Build();
            #endregion

            host.Run();
        }
    }
}
